﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VK.Comm;
using System.Web.UI.WebControls;

namespace VK.Casemeet.Employees
{
    public static class EmployeeHelper
    {
        public static void BindRoleDDL(DropDownList ddl, OptionType optionType)
        {
            ddl.Items.Clear();
            ddl.DataSource = RoleBLL.GetRoleList();
            ddl.DataTextField = "Name";
            ddl.DataValueField = "RoleID";
            ddl.DataBind();
            switch (optionType)
            {
                case OptionType.Default: break;
                case OptionType.Search: ddl.Items.Insert(0, new ListItem("全部", "0")); break;
                case OptionType.Select: ddl.Items.Insert(0, new ListItem("请选择", "0")); break;
            }
            ddl.SelectedIndex = 0;
        }
    }
}
